<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <div class="container"></div>
    <script src="./js/echarts.min.js"></script>
    <script>
      const myEcharts = echarts.init(document.querySelector(".container"));
      const option = {
        // x轴
        xAxis: {
          data: [
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六",
            "星期天",
          ],
        },
        // y轴
        yAxis: {},
        // 系列
        series: [
          {
            data: [20, 30, 50, 40, 20, 10, 60],
            type: "line", // 折线图
          },
          {
            data: [23, 40, 30, 50, 30, 20, 30],
            type: "line",
          },
          {
            data: [23, 40, 30, 50, 30, 20, 30],
            type: "bar", // 柱形图 或 柱状图
          },
          {
            data: [
              { name: "吃饭", value: 11 },
              { name: "睡觉", value: 22 },
              { name: "敲代码", value: 33 },
            ],
            type: "pie", // 饼图
            center: [600, 70], // 圆心位置
            radius: [30, 50], // 内外圆半径
          },
        ],
      };
      myEcharts.setOption(option);
    </script>
  </body>
</html>
